package zestaw4.zadanie1;

/**
 * Author: Daniel
 * Date: 03.08.13
 */

public class Student {
    private Person person;
    private int age;

    public Student(Person person, int age) {
        this.person = person;
        this.age = age;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Student)) return false;
        Student student = (Student) obj;
        return age == student.age &&
                person.getName().equals(student.person.getName());
    }
}
